/*
 * RmsUtil.java
 * 
 * Copyright (c) 2011 Administrator. 
 * 
 * This file is part of RMS.
 * 
 * RMS is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * RMS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with RMS.  If not, see <http ://www.gnu.org/licenses/>.
 */
package com.itrustsolution.rms.util;

/**
 *
 * @author Administrator
 */
public class RmsUtil {

    /**
     * Method untuk validasi sebuah Object apakah null atau tidak.
     * Method ini juga memvalidasi apakah sebuah String berisi data kosong atau tidak
     * @param param
     * @return  true    jika kosong atau null
     */
    public static boolean isNullOrEmpty(Object param) {
        try {
            if (param instanceof String) {
                if (param == null) {
                    return true;
                } else if ("".equalsIgnoreCase((String) param)) {
                    return true;
                }
            } else {
                return true;
            }
        } catch (NullPointerException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }
}
